package com.wf.classRoomTest;
 
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.TreeMap;
 
 
/**
 * @author 崔冉
 * @version 1.0.0
 * @desc
 */
 
public class Test {
 
	public void deleteFiles(File file){
			if(file.isDirectory()){
			File [] files=	file.listFiles();
		
			
			  for(int i=0;i<files.length;i++){
				  deleteFiles(files[i]);
				  
				  if(files[i].listFiles().length==0){
						System.out.println(files[i].delete());
				  }
				
			  }
			
			}else{
				System.out.println(file.delete());
			}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		
		String filePah="C:\\Users\\mpk16\\Desktop\\homeWork0523\\test";
		File file =new File(filePah);

		FileUtils.forceDelete(file);
		
		Test t=new Test();
		t.deleteFiles(file);
	}
 
}